#pragma once
#include "TBasis2DStd.h"
class Tower;
class Monster;
class Bullet;
class Object;

class ObjectManager : public TSingleton<ObjectManager>
{
private:
	friend class TSingleton<ObjectManager>;
	vector<Tower*> m_vTowers;
	vector<Monster*> m_vMonsters;
	vector<Bullet*> m_vBullets;

public:
	void AddTower(Tower *tower);
	void AddMonster(Monster *monster);
	void AddBullet(Bullet *bullet);

	Tower* GetTower(int index);
	Monster* GetMonster(int index);
	Bullet* GetBullet(int index);

	void DeleteTower(Tower *tower);
	void DeleteMonster(Monster *monster);
	void DeleteBullet(Bullet *bullet);

	int GetTowerIndex(Tower* tower);
	int GetMonsterIndex(Monster* monster);
	int GetBulletIndex(Bullet* bullet);

	int GetMaxTower()
	{
		return m_vTowers.size();
	}
	int GetMaxMonster()
	{
		return m_vMonsters.size();
	}
	int GetMaxBullet()
	{
		return m_vBullets.size();
	}

	bool Release();
private:
	ObjectManager(void);
public:
	~ObjectManager(void);
};
#define I_ObjectMgr ObjectManager::GetInstance()

